# 导包
import app

# 定义接口类
class InvestAPI:
    # 初始化
    def __init__(self):
        self.invest_info_url = app.BASE_URL + '/common/loan/loaninfo'
        self.invest_data_url = app.BASE_URL + '/trust/trust/tender'
        self.my_invest_info_url = app.BASE_URL + '/loan/tender/mytenderlist'

    # 定义获取投资详情接口方法
    def get_invest_info(self, session, id):
        return session.post(self.invest_info_url, data={'id': id})

    # 定义获取投资数据的接口方法
    def invest_data(self, session, id, amount):
        data = {"id": id, "amount": amount}
        return session.post(self.invest_data_url, data=data)

    # 定义获取我的投资列表信息
    def my_invest_info(self, session, status='tender'):
        data = {'status': status}
        return session.post(self.my_invest_info_url, data=data)













































